import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

//在字符串中找到最长的连续数字字符串
public class test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();//用来接收字符串,然后变为字符数组
        char[] chars = s.toCharArray();
        Queue<Character> queue1 =new LinkedList<>();//用来获取最长的数字串
        Queue<Character> queue2 = new LinkedList<>();//用来比较
        for (int i = 0; i < chars.length; i++) {
         //遍历数组,判断是否是数字
         if(Character.isDigit(chars[i])){
             queue2.add(chars[i]);
             continue;//如果是数字就直接接着循环
         }
         //不是数字,就要进行长度对比
            if (queue2.size()>queue1.size()){
                queue1.clear();
                queue1.addAll(queue2);
                queue2.clear();
            }
            queue2.clear();
        }
        if (queue2.size()>queue1.size()){
            queue1.clear();
            queue1.addAll(queue2);
            queue2.clear();
        }
        while (!queue1.isEmpty()){
            System.out.print(queue1.poll());
        }
    }
}
